<template>
	<!-- 子表信息模板 -->
	<view class="collapse" :style="{borderRadius: borderRadius + 'px'}">
		<view :class="['collapse_title', hasIcon ? 'has-icon' : '']">
			<view class="collapse_name">{{ name }}</view>
			<slot name="right"></slot>
		</view>
		<view class="line"></view>
		<view class="collapse_content">
			<slot></slot>
		</view>
		<slot name="handler"></slot>
	</view>
</template>
<script>
	export default {
		data() {
			return {
			}
		},
		props: {
			name: {
				type: String
			},
			borderRadius: {
				default: 10
			},
			hasIcon: {
				default: false
			}
		},
		methods: {
		}
	}
</script>
<style lang="scss" scoped>
.collapse{
	width: 100%;
	background: #FFFFFF;
	box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.1000);
	// border-radius: 10px;
	margin-bottom: 20rpx;
	.collapse_title{
		padding: 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.collapse_name{
			font-size: 14px;
			// font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #171717;
			line-height: 20px;
		}
	}
	.has-icon{
		position: relative;
		.collapse_name {
			margin-left: 12rpx;
			font-size: 16px;
			font-weight: 500;
			color: #333333;
		}
	}
	.has-icon::after{
		position: absolute;
		content: "";
		width: 6rpx;
		height: 29rpx;
		background: #1E6FFF;
	}
	.collapse_content{
		padding: 0 32rpx 32rpx;
	}
}
.line{
	width: 100%;
	background: rgba(0,0,0,0.1);
	height: 2rpx;
}
</style>